# prefix
unbind C-b
set -g prefix c-a
bind c-a send-prefix

# History
set -g history-limit 10000

# custom run alias for git-cola 
bind-key -T root F1 send-keys 'wcola' Enter

# bind reload key
bind-key r source-file ~/.tmux.conf \; display-message "Config reloaded!"

# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# Use Alt-arrow keys to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Set easier window split keys
bind-key v split-window -h
bind-key b split-window -v

# Mouse mode
set -g mouse on
setw -g mode-keys vi

# don't rename windows automatically 
set-option -g allow-rename off

# color
set -g default-terminal "screen-256color"

# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1

set-option -g status-position top

set-option -g repeat-time 0

# Removes ESC delay
set -sg escape-time 0

# List of plugins
set -g @tpm_plugins '                     \
    caiogondim/maglev                     \
    tmux-plugins/tpm                      \
    tmux-plugins/tmux-sensible            \
    tmux-plugins/tmux-pain-control        \
    tmux-plugins/tmux-copycat             \
    tmux-plugins/tmux-yank             \
    tmux-plugins/tmux-open                \
    tmux-plugins/tmux-prefix-highlight    \
'

# tmux-resurrect
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

set -g @continuum-save-interval '6000'
set -g @continuum-restore 'on'
set -g @resurrect-save-bash-history 'on'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'

set-option -g default-command '/usr/bin/zsh'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
